package com.kancy.drools.helloworld;

import com.kancy.drools.helloworld.data.DataArea;
import org.drools.compiler.kproject.ReleaseIdImpl;
import org.kie.api.KieServices;
import org.kie.api.builder.ReleaseId;
import org.kie.api.runtime.KieContainer;
import org.kie.api.runtime.KieSession;

/**
 * @author kancy
 * @date 2020/1/17 21:18
 **/
public class Application {
    public static void main(String[] args) {
        KieServices kieServices = KieServices.Factory.get();
        KieContainer kieContainer = kieServices.newKieClasspathContainer();
        KieSession kieSession = kieContainer.newKieSession("hello-world");

        DataArea dataArea = new DataArea();
        dataArea.put("message","Hello World!");
        kieSession.insert(dataArea);
        kieSession.fireAllRules();
        kieSession.dispose();
    }
}
